﻿using System;
using System.Windows.Data;

namespace Converter
{
    public class BusyIndicatorConverter : IMultiValueConverter
    {
        #region IMultiValueConverter Members

        public object Convert(object[] values, Type targetType,
          object parameter, System.Globalization.CultureInfo culture)
        {
            bool result = false;
            if (values != null && values.Length > 0) 
            {
                foreach (object value in values) 
                {
                    bool source = value==null ? false : (bool)value;
                    result = result || source;
                } 
            }

            return result;
        }

        public object[] ConvertBack(object value, Type[] targetTypes,
          object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
